package main

import (
	"net/http"
	file_controller "upload-file-demo/controller"
	global_middleware "upload-file-demo/middleware"

	"github.com/gin-gonic/gin"
)

func main() {
	r := gin.Default()
	r.Static("/static", "./public")
	r.Use(global_middleware.Cors())
	r.GET("/api/ping", func(c *gin.Context) {
		c.JSON(http.StatusOK, gin.H{
			"message": "pong",
		})
	})
	r.POST("/api/file/upload", file_controller.Upload)
	r.Run(":9000")
}
